<?php
namespace Products\Model;

class Offers
{
	public $offer_id;
	public $product_id;
	public $offer_content;
	public $offer_for_quantity;
	public $offer_price;
	public $offer_status;
	public $added_date;
	public $expire_date_from;
	public $expire_date_to;
	public $modified_date;
	
	public function exchangeArray($data){
	
		$this->offer_id          = (isset($data['offer_id']))       ? $data['offer_id']  : null;
		$this->product_id        = (isset($data['product_id']))     ? $data['product_id']	  : null;		
		$this->offer_content     = (isset($data['offer_content']))  ? $data['offer_content']  : null;		
		$this->offer_for_quantity = (isset($data['offer_for_quantity'])) ? $data['offer_for_quantity']   : null;
		$this->offer_price       = (isset($data['offer_price']))    ? $data['offer_price']    : null;
		$this->offer_status      = (isset($data['offer_status']))   ? $data['offer_status']   : null;
		$this->added_date        = (isset($data['added_date']))     ? $data['added_date']     : null;
		$this->expire_date_from  = (isset($data['expire_date_from']))? $data['expire_date_from']  : null;
		$this->expire_date_to    = (isset($data['expire_date_to']))  ? $data['expire_date_to']: null;
		$this->modified_date     = (isset($data['modified_date']))  ? $data['modified_date']  : null;		
	}

	// Add the following method:
	public function getArrayCopy()
	{
		return get_object_vars($this);
	}

}